package model
{
	import flash.desktop.NativeApplication;
	import flash.filesystem.File;
	
	import mx.binding.utils.BindingUtils;
	import mx.collections.XMLListCollection;
	
	import org.robotlegs.mvcs.Actor;
	
	import spark.filters.DropShadowFilter;

	public class ModelProject extends Actor {
		
		[Bindable]
		public var projectName:String = DEFAULT_PROJECT_NAME;
		
		public const DEFAULT_PROJECT_NAME:String = "Untitled";
		
		[Bindable]
		public var projectModified:Boolean = false;
		
		[Bindable]
		public var version:String = "versionNr";
		
		[Bindable]
		public var appName:String = "AppName";
		
		[Bindable]
		public var menuXML:XMLListCollection =  new XMLListCollection();
		
		public var projectFilePath:String;

		public const PROJECT_FILE_IDENTIFIER:String = "IsoFlash"
		
		public const newItemName:String = "untitled";
		
		public const projectFileIdentifier:String = "IsoEditor file identifier";
		
		public function getSelectionFilters() : Array {
			return [new DropShadowFilter(0, 0, 0xffffff,1, 6,6,5), new DropShadowFilter(0, 0, 0,1, 6,6,5)];
			
		}
		
		public function ModelProject() : void {
			BindingUtils.bindSetter(setMenuXML, this, "projectModified");
		}
		
		private function setMenuXML(e:Object) : void {
			menuXML = new XMLListCollection(
					new XMLList(
						'<menuitem label="File">'+
						'<menuitem data="newproject" label="New..."/>'+
						'<menuitem enabled="' + projectModified + '" data="save" label="Save"/>'+
						'<menuitem data="saveas" label="Save As..."/>'+
						'<menuitem data="load" label="Open"/>'+
						'</menuitem>'+
						'<menuitem data="help" label="Help">'+
						'<menuitem data="about" label="About"/>'+
						'</menuitem>'));
		}
	}
}